﻿using System;
using Ayatta.Contract.Domain;
using Web.Core.EventArgs;
using Web.Core.Models.Game;

namespace Web.Core.GameProxys
{
    public interface IGameClient
    {
        /// <summary>
        /// 游戏Id
        /// </summary>
        int GameId { get; }

        /// <summary>
        /// 从游戏方成功获取到用户信息后触发事件
        /// </summary>
        event EventHandler<EventArgs<UserInfo>> Updated;

        /// <summary>
        /// 游戏方充值成功后触发事件
        /// </summary>
        event EventHandler<EventArgs<OrderInfo>> Recharged;

        /// <summary>
        /// 获取登录url
        /// </summary>
        /// <param name="guid">用户GUID</param>
        /// <param name="param">参数</param>
        /// <returns></returns>
        string GetLoginUri(string guid, params string[] param);

        /// <summary>
        /// 检查用户是否创建角色
        /// </summary>
        /// <param name="guid">用户GUID</param>
        /// <param name="param">参数</param>
        /// <returns></returns>
        MagicKit<string> CheckUser(string guid, params string[] param);

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="guid">用户GUID</param>
        /// <param name="serverId">游戏区服Id</param>
        /// <param name="param">参数</param>
        /// <returns></returns>
        MagicKit<UserInfo> GetUser(string guid, int serverId, params string[] param);
        
        /// <summary>
        /// 充值
        /// </summary>
        /// <param name="guid">用户GUID</param>
        /// <param name="order">订单</param>
        /// <param name="param">参数</param>
        /// <returns></returns>
        MagicKit<OrderInfo> Recharge(string guid, OrderInfo order, params string[] param);
    }
}